<template>
    <h3>ComponentParent</h3>
    <p>父元素：{{message}}</p>
    <ComponentChild title="标题" :onEvent="dataFn"/>
</template>

<script>
import ComponentChild from "./ComponentChild.vue"
export default {
    data() {
        return {
            message:""
        }
    },
    components:{
        ComponentChild
    },
    methods:{
        dataFn(data){
            console.log(data);
            this.message=data;
        }
    }

}
</script>